package com.topboya.officeuser.lambda;

import org.junit.jupiter.api.Test;

import java.io.PrintStream;
import java.util.function.Consumer;

/**
 * @className CoteMethod
 * @Author xiaxin
 * @Date 2020/8/25 15:59
 * @Version 1.0
 **/


public class CoteMethod {
    public static void main(String[] args) {
        PrintStream ps = System.out;
        Consumer<String> conn = (s) -> ps.println(s.substring(1,s.length()));
        conn.accept("hahaha");

        Consumer<String> conns = ps::println;
        conns.accept("println hello world!");
    }

    @Test
    public void test2(){
        PrintStream ps = System.out;
        Consumer<String> conn = ps::println;
        conn.accept("println hello world!");
    }

}
